import { getTypeListApi } from '@/api/type/type'

// 获取类型列表hooks
export default function useGetTypeList() {
  const typeOptions = ref([])
  const typeLoading = ref(false)

  const fetchGetTypeList = async () => {
    typeLoading.value = true
    const res = await getTypeListApi()
    if (res.code === '0000') {
      typeOptions.value = res.data
    }
    typeLoading.value = false
  }

  fetchGetTypeList()

  return {
    typeOptions,
    typeLoading
  }
}
